package com.kaili.basic.service.impl;

/**
 * Created by xxx on 2019-03-07.
 */

import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.mapper.RentMapper;
import com.kaili.basic.pojo.dto.RentQueryDto;
import com.kaili.basic.pojo.entity.Rent;
import com.kaili.basic.pojo.entity.RentExport;
import com.kaili.basic.service.RentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author xxx
 * @Copyright: Copyright (c) 2017
 * @Company: 杭州凯立通信有限公司
 */
@Service
@Transactional
public class RentServiceImpl implements RentService {
    @Autowired
    RentMapper rentMapper;

    @Override
    public int addRent(Rent rent) {
        return rentMapper.addRent(rent);
    }

    @Override
    public int deleteRent(Rent rent) {
        return rentMapper.deleteRent(rent);
    }

    @Override
    public int deleteRents(Map<String,Object> map) {
        return rentMapper.deleteRents(map);
    }

    @Override
    public int updateRent(Rent rent) {
        return rentMapper.updateRent(rent);
    }

    @Override
    public Page<Rent> queryRent(Page<Rent> page,Rent rent) {
        List<Rent> rents = rentMapper.queryRent(page,rent);
        return page.setRecords(rents);
    }

    @Override
    public Integer querySupplierAndWarehouse(Rent rent) {
        return rentMapper.querySupplierAndWarehouse(rent);
    }

    @Override
    public Rent queryRentById(Long rentId) {
        return rentMapper.queryRentById(rentId);
    }

    @Override
    public List<RentExport> queryRentExport(RentQueryDto rentQueryDto) {
        return rentMapper.queryRentExport(rentQueryDto);
    }
}
